package com.lzy.webapi.controller;
import com.lzy.framework.core.output.Result;
import com.lzy.webapi.component.UserToken;
import com.lzy.webapi.facade.MemberCheckLogFacade;
import com.lzy.webapi.request.MemberCheckLogRequest;
import com.lzy.webapi.response.MemberCheckLogResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by WIN7 on 2018/4/8.
 */
@Controller
@RequestMapping("api/check/log")
public class MemberCheckLogController extends BaseController{

    @Autowired
    private MemberCheckLogFacade memberCheckLogFacade;


    /**
     * 核销记录
     *
     * @param token
     * @param request
     * @return
     */
    @RequestMapping(value = "/list", method = RequestMethod.POST)
    @ResponseBody
    public Result getCheckLogList(@RequestHeader("token") String token, MemberCheckLogRequest request){
        UserToken ut = isLogin(token);
        Result result = new Result();
        List<MemberCheckLogResponse> memberCheckLogResponseList = memberCheckLogFacade.selectCheckLogList(request,ut.getUserId());
        result.setResult(memberCheckLogResponseList);
        return result;
    }


}
